package cn.easthome.demo.day0060_pm.service;

import cn.easthome.demo.day0060_pm.dao.IJobInfoDao;
import cn.easthome.demo.day0060_pm.dao.JobInfoDaoImpl;
import com.alibaba.fastjson2.JSON;

/**
 * IJobInfoService的实现类
 */
public class JobInfoServiceImpl implements IJobInfoService{

    private IJobInfoDao jobInfoDao = new JobInfoDaoImpl();

    @Override
    public String getCenter2Str() {
        //1.从数据库查询center的数据（数据访问层）
        Object center2Data = jobInfoDao.getCenter2Data();
        //2.把数据转换成json字符串
        String jsonStr = JSON.toJSONString(center2Data);
        return jsonStr;
    }
}
